package security;

import security.ConsoleUsernamePasswordAuthProvider.ConsoleSignup;

import com.feth.play.module.pa.providers.password.UsernamePasswordAuthUser;
import com.feth.play.module.pa.user.FirstLastNameIdentity;

public class ConsoleUsernamePasswordAuthUser extends UsernamePasswordAuthUser implements FirstLastNameIdentity {
	
	private static final long serialVersionUID = 1L;
	
	private String firstName;
	private String lastName;
	
	public ConsoleUsernamePasswordAuthUser(final ConsoleSignup signup) {
		super(signup.password, signup.email);
		this.firstName = signup.firstName;
		this.lastName = signup.lastName;
	}
	
	public ConsoleUsernamePasswordAuthUser(final String clearPassword, final String email) {
		super(clearPassword, email);
		this.firstName = null;
		this.lastName = null;
	}
	
	@Override
	public String getFirstName() {
		return firstName;
	}
	
	@Override
	public String getLastName() {
		return lastName;
	}
	
	public String getName() {
		return (firstName + " " + lastName).trim();
	}
	
}
